1. Field of the Invention
The present invention relates to a printing apparatus capable of executing wireless communication, a control method for the printing apparatus, and a storage medium.
2. Description of the Related Art
Recently, there are a number of devices having wireless local area network (LAN) capabilities conforming to the institute of electrical and electronics engineers (IEEE) 802.11 standard. Moreover, Japanese Patent Application Laid-Open No. 2002-300175 discusses a power saving mode for wireless LAN. This power saving mode is known as a technique for reducing power consumption of a wireless communication unit for executing wireless communication. Such a power saving mode is described with reference to FIGS. 1 and 2.
FIG. 1 illustrates processing executed when the power saving mode is disabled. In FIG. 1, a printing apparatus is described as a device having a wireless LAN capability. When the power saving mode in the printing apparatus is disabled, a wireless communication unit of the printing apparatus is always in an awake state, that is, the power is supplied to the wireless communication unit. When the wireless communication unit is in the awake state, the printing apparatus can transmit data to an external device or receive data transmitted from the external device via wireless communication.
At timing 101 illustrated in FIG. 1, an access point receives data 1 addressed to the printing apparatus from the external device such as a personal computer (PC). At timing 102, the access point transmits the data 1 to the printing apparatus. Although the access point transmits a signal called a beacon at a certain interval to a peripheral device, the transmission of the data 1 at timing 102 illustrated in FIG. 1 is executed regardless of the beacon interval.
FIG. 2 illustrates processing executed when the power saving mode is enabled. The wireless communication unit repeatedly transitions between the awake state and a doze state when the power saving mode is enabled. In the doze state, the power supply to the wireless communication unit is stopped or reduced. Accordingly, when the wireless communication unit is in the doze state, the printing apparatus cannot transmit data to the external device or receive data transmitted from the external device via wireless communication.
When the power saving mode is enabled, the wireless communication unit intermittently transitions from the doze state to the awake state at timing 201 through timing 203 in synchronization with the beacon interval of the access point. At timing 204, the access point receives data 1 (data addressed to the printing apparatus) transmitted from the PC. At timing 205, the access point notifies the printing apparatus of the presence of the data addressed to the printing apparatus by using information called a traffic indication message (TIM) or a delivery traffic indication message (DTIM). The TIM is information used to notify the printing apparatus of the presence of the data addressed to the printing apparatus. The DTIM is a type of the TIM, and indicates that the data to be transmitted is multicast or broadcast data.
At timing 206 illustrated in FIG. 2, the printing apparatus transitions to the awake state, and receives the TIM notified at timing 205. At timing 207, the printing apparatus requests the access point to transmit the data. At timing 208, the access point transmits the data 1 to the printing apparatus in response to the request.
When the power saving mode is enabled, the wireless communication unit transitions from the awake state to the doze state on condition that data is not transmitted or received between the printing apparatus and the access point for a predetermined time period (e.g., half the time of the beacon interval) in the awake state. At timing 210 illustrated in FIG. 2, when a predetermined time period 209 has elapsed since reception of the data 1 is completed, the wireless communication unit transitions from the awake state to the doze state. After transitioning to the doze state, the wireless communication unit intermittently transitions from the doze state to the awake state in synchronization with the beacon interval of the access point as similar to the transition at timing 201 through timing 203. The condition causing the wireless communication unit to transition from the awake state to the doze state is not limited to the lapse of the predetermined time period 209. The wireless communication unit may transition from the awake state to the doze state on condition that the data addressed to the printing apparatus is not accumulated on the access point. In such a case, the absence of the accumulated data on the access point is confirmed by using the beacon.
Therefore, when the power saving mode is enabled, the wireless communication unit of the printing apparatus repeatedly transitions between the awake state and the doze state. That is, the wireless communication unit does not always remain in the awake state. Accordingly, in a case where the power saving mode is enabled, power consumption of the wireless communication unit of the printing apparatus can be reduced compared to a case where the power saving mode is disabled.
Although the power consumption of the wireless communication unit can be reduced, a communication delay tends to occur in a case where the power saving mode for wireless LAN enabled. The communication delay occurs at the time when the printing apparatus receives the data transmitted from the access point. A reason for the communication delay is described with reference to FIG. 3.
For example, the PC transmits data having a large volume (large-size data) to the printing apparatus through the access point. In such a case, the large volume data is divided into smaller volume data, and each of the divided data is transmitted to the printing apparatus. FIG. 3 illustrates an example case where the large volume data is divided into data 1, data 2, and data 3, and each of the divided data 1, 2, and 3 is transmitted to the printing apparatus. At timing 301, the access point receives data 1 transmitted from the PC. If the power saving mode were disabled, the access point could immediately transmit the data 1 to the printing apparatus. However, since the power saving mode is enabled, the access point needs to wait until timing of a next beacon and transmits the data 1. That is, the communication delay of a time period 302 occurs compared to a case where the power saving mode is disabled.
After receiving the data 1, the wireless communication unit of the printing apparatus transitions from the awake state to the doze state at timing 303 if any data is not transmitted or received for a predetermined time period. When the access point receives data 2 from the PC at timing after the timing 303 as illustrated in FIG. 3, the access point waits until timing of a next beacon and transmits the data 2 to the printing apparatus. That is, even when the data 2 is transmitted to the printing apparatus, the communication delay of a time period 304 occurs. Similarly, when data 3 is transmitted to the printing apparatus, the communication delay of a time period 305 occurs.
In the example illustrated in FIG. 3, the large volume data is divided into three pieces of data and transmitted. Alternatively, data such as a print job having a larger volume may be transmitted. In such a case, the data is divided into a larger number of pieces. This causes the communication delay to be more significant. Since the communication delay causes completion of print processing based on the print job to be delayed, user convenience becomes lowered. Moreover, in some printing apparatuses, if data reception is not completed in a predetermined time period, the data reception is finished as an error. Therefore, when the power saving mode becomes enabled, not only the communication delay tends to occur, but also data communication may fail.